<?php


namespace xzdream;


use Symfony\Component\HttpFoundation\Request;

class HttpFoundation
{
    private $request;

    public function __construct()
    {
        $this->request = Request::createFromGlobals();
    }

    /**
     * 获取端口
     * @return int|string
     */
    public function getPort(){
        return $this->request->getPort();
    }

    /**
     * http://www.mephp.com/?a=2&w=1
     * @return array Array ( [a] => 2 [w] => 1 )
     */
    public function getAll(){
        return $this->request->query->all();
    }

    /**
     * @return resource|string
     */
    public function getContent(){
        return $this->request->getContent();
    }

}